home *** CD-ROM | disk | FTP | other *** search
/ PC Format Collection 13 / PCFORMAT.bin / demo.dir / 00035_Script_Myscore script < prev    next >
Text File  |  1995-03-06  |  8KB  |  285 lines

  1. --Smalltown heroes
  2. --Programming ⌐ 1994 The Last Museum Catalogue Co
  3.  
  4. global gMachineType     -- legal values are "Mac" or "PC"
  5. global gDebug           -- Boolean : If true debug information is sent to message window
  6. global gRAMavailable    -- Integer : RAM available at startup
  7. global gmovieSprite     -- The sprite channel that movies get played in
  8. global gLyricSprite     -- The sprite channel lyrics are displayed in
  9. global gTrack           -- the currently playing CDDA audio track
  10. global stopEnable       -- if true, then the last lyric displayed stops the CD audio
  11.  
  12. on Init
  13.   -- This is the first handler called by the movie
  14.   -- This handler determines :
  15.   --     that the machine has enough RAM
  16.   --     If the machine is a Mac or PC
  17.   --     the path name to the current directory
  18.   --     if Quicktime is present
  19.   --     the colordepth of the monitor the stage is on
  20.   global gMachineType, gRAMavailable, gOriginalColorDepth, gMyPathName, gDebug
  21.   global Macintosh, gmovieSprite, gAVPathName, gLyricSprite, gTrack
  22.   global lastTC
  23.   global movie1duration, movie2duration
  24.   
  25.   if Macintosh then
  26.     set gOriginalColorDepth = the colorDepth -- store this for reseting the monitor at quit time
  27.     if gDebug then put "original colordepth =" && the colorDepth
  28.     
  29.     set the colorDepth = 32 -- for now, assume the mac has millions of colurs
  30.     
  31.     if gDebug then put "the colordepth =" && the colorDepth
  32.   end if
  33.   
  34.   cursor 4
  35.   -- show progress bar
  36.   set the visible of sprite 36 to TRUE
  37.   set the visible of sprite 37 to TRUE
  38.   puppetsprite 37 TRUE
  39.   set the castnum of sprite 37 to 73
  40.   updatestage
  41.   
  42.   --put "RAM needed" && ramneeded (1,55) / 1024
  43.   if the machineType = 256 then
  44.     set gMachineType = "PC"
  45.     set Macintosh = FALSE
  46.   else
  47.     set gMachineType = "Mac"
  48.     set Macintosh = TRUE
  49.   end if
  50.   
  51.   set gLyricSprite = 33
  52.   set the visible of sprite gLyricSprite to FALSE
  53.   updatestage
  54.   
  55.   puppetSprite gLyricSprite, TRUE
  56.   set the castnum of sprite gLyricSprite to 148 -- set lyric text to a null string
  57.   
  58.   
  59.   
  60.   
  61.   --update loading bar
  62.   set the castnum of sprite 37 to 74
  63.   updatestage
  64.   
  65.   if Macintosh then
  66.     put the pathname into Mypath
  67.     put Mypath & "qt" into MyQTpath
  68.     put Mypath & "images8" into MyAVpath
  69.     
  70.     set the searchpath to ["heroes:images8","heroes:qt", Mypath, MyQTpath, MyAVpath]
  71.     --put the searchpath
  72.   else
  73.     if gDebug then put "setting searchpath"
  74.     
  75.     set the searchpath to ["d:\images8\", "d:\qt\",¼
  76.                            "g:\images8\", "g:\qt\",¼
  77.                            "e:\images8\", "e:\qt\",¼
  78.                            "f:\images8\", "f:\qt\",¼
  79.                            "h:\images8\", "h:\qt\",¼
  80.                            "i:\images8\", "i:\qt\",¼
  81.                            "j:\images8\", "j:\qt\",¼
  82.                            "k:\images8\", "k:\qt\",¼
  83.                            "l:\images8\", "l:\qt\",¼
  84.                            "m:\images8\", "m:\qt\",¼
  85.                            "n:\images8\", "n:\qt\",¼
  86.                            "o:\images8\", "o:\qt\",¼
  87.                            "p:\images8\", "p:\qt\",¼
  88.                            "r:\images8\", "r:\qt\",¼
  89.                            "s:\images8\", "s:\qt\",¼
  90.                            "t:\images8\", "t:\qt\",¼
  91.                            "v:\images8\", "v:\qt\",¼
  92.     "q:\heroes\images8\", "q:\heroes\"]
  93.     
  94.     
  95.     
  96.     if gDebug then put "completed"
  97.   end if
  98.   
  99.   --update loading bar
  100.   set the castnum of sprite 37 to 75
  101.   updatestage
  102.   
  103.   if integer(the memorySize /1024) < 1000 then
  104.     alert "Warning : less than 1000 K of RAM is availble"
  105.   end if
  106.   
  107.   if integer(the freeBlock) / 1024 < 750 then
  108.     alert "Warning : less than 750 K of contiguous free RAM available :only "  && ¼
  109.         integer(the freeBlock) / 1024  && "available"
  110.   end if
  111.   
  112.   if the quickTimePresent then
  113.     continue
  114.   else
  115.     alert "Quicktime not found"
  116.     quit
  117.   end if
  118.   if gDebug then put "setting pathnames"
  119.   
  120.   put the pathName into gMyPathName
  121.   if gDebug then put "got the pathname" && gMypathName
  122.   --set the path for the 'av' director movie
  123.   if macintosh then
  124.     put gMyPathname & "images8:" into gAVpathName
  125.     set the fileName of cast 64 to "Heroes:qt:Studio4.mov"
  126.     
  127.  
  128.   else
  129.     put gMyPathname & "images8\" into gAVpathName
  130.     set the castnum of sprite 37 to 76
  131.     updatestage
  132.     if gDebug then put "setting name for 64"
  133.     set the fileName of cast 64 to "Studio4.mov"
  134.     set the castnum of sprite 37 to 77
  135.     updatestage
  136.  
  137.     
  138.   end if
  139.   if gDebug then put "complete"
  140.   set the castnum of sprite 37 to 78
  141.   updatestage
  142.   if gDebug = TRUE then
  143.     put "Machine type = " && the machinetype
  144.     put "Colordepth = " && the colordepth
  145.     put "Freeblock = " && the freeBlock / 1024
  146.     put "Freebytes = " && the freebytes / 1024
  147.     put "MemorySize = " && the memorysize / 1024
  148.     put "Pathname = " && gMyPathName
  149.     put "AV Pathname = " && gAVPathName
  150.     
  151.   end if
  152.   
  153.   set gmovieSprite = 10
  154.   set the visible of sprite gMoviesprite to FALSE
  155.   updatestage
  156.   
  157.  
  158.   if gDebug then put "complete"
  159.   --set the default CDDA audio to track to 0
  160.   set gTrack = 0
  161.   
  162.  
  163.   put the duration of cast 64 into movie1duration
  164.   
  165.   --set up QTmovies initial states
  166.   --set the preloadRAM to 1000 * 1024
  167.   
  168.   set the preload of cast 64 to FALSE
  169.   set the pausedAtStart of cast 64 to FALSE
  170.   set the directToStage of cast 64 to TRUE
  171.   set the controller of cast 64 to FALSE
  172.   set the sound of cast 64 to 1
  173.   
  174.  
  175.   
  176.   set the castnum of sprite 37 to 79
  177.   updatestage
  178.   
  179.   cursor -1
  180. end
  181.  
  182. on startMovie
  183.   global gMovieSprite, Macintosh, gTrack, gDebug, lastTC
  184.   if gDebug then put "executing start movie"
  185.   
  186.   set the visible of sprite gMovieSprite to FALSE
  187.   updatestage
  188.   put 0 into field "framesInToTrack"
  189.   set gTrack = 0
  190.   if the shiftDown then
  191.     set gDebug = TRUE
  192.     
  193.   else
  194.     set gDebug = FALSE
  195.   end if
  196.   
  197.  
  198. end
  199.  
  200. on stopMovie
  201.   global gMovieSprite, Macintosh, gTrack, gDebug, lastTC
  202.   if macintosh then
  203.     nothing
  204.   else
  205.     if gDebug then
  206.       
  207.       set the traceLogFile to ""
  208.     end if
  209.     
  210.     mci  "close CDaudio"
  211.     if gDebug then put the result
  212.   end if
  213. end
  214.  
  215.  
  216. on playmovie1
  217.   -- studio movie
  218.   global gMovieSprite, Macintosh, gMoviePlaying, movie1duration    
  219.   global movieduration
  220.  
  221.   if the movierate of sprite gMovieSprite = 1 and the castnum of sprite gMovieSprite = 64 and ¼
  222. the visible of sprite gMovieSprite = TRUE then
  223.     if gdebug then put "movie already playing"
  224.     endmovie
  225.   else
  226.     puppetSprite gmovieSprite, TRUE
  227.     set gMoviePlaying = 1
  228.     cursor 4
  229.     put movie1duration into movieduration
  230.     if gdebug then put "movieduration" && movieduration
  231.     if gdebug then put "preload of cast 64 = " && the preload of cast 64
  232.     
  233.     --preloadCast 64
  234.     if gdebug then put "preload of cast 64 = " && the preload of cast 64
  235.     
  236.     set the castnum of sprite gMovieSprite to 64
  237.     set the volume of sprite gMovieSprite to 255
  238.     set the visible of sprite gMovieSprite to TRUE
  239.     set the controller of cast 64 to TRUE
  240.     
  241.     updatestage
  242.     
  243.     set the movierate of sprite gMovieSprite to 1
  244.     
  245.     updatestage
  246.     
  247.     
  248.     cursor -1
  249.     
  250.   end if
  251.   
  252. end
  253.  
  254.  
  255.  
  256. on endmovie
  257.   global gMovieSprite, Macintosh
  258.   cursor 4
  259.   
  260.   set the movierate of sprite gMovieSprite to 0
  261.   
  262.   set the visible of sprite gMovieSprite to FALSE
  263.   
  264.   cursor -1
  265. end
  266.  
  267.  
  268.  
  269.  
  270. on FlashRoller whichChannel, scriptToExecute
  271.   set myCast = the mouseCast    
  272.   set flag = 0    
  273.   if the mouseDown then       
  274.     set the castNum of sprite whichChannel = myCast + 1      
  275.     updateStage            
  276.     repeat while the mouseDown        
  277.       if not rollover(whichChannel) then exit repeat        
  278.     end repeat           
  279.     if rollover(whichChannel) then set flag = 1                  
  280.   end if          
  281.   if flag then do scriptToExecute    
  282. end 
  283.  
  284.  
  285.